The code in \texttt{bayes.m}, in appendix \ref{app:bayes}, presents a bayesian
classifier. The classifier is programmed according to the assignment. 

For a bayesian classifier, a `prior' has to be assumed. In this particular case,
the prior is instantiated by $$P(C_{Spam}) = \frac{Count(Spam)}{Count(Spam) + Count(Ham)}$$
and $$P(C_{Ham}) = \frac{Count(Ham)}{Count(Spam) + Count(Ham)}.$$
This would, in a real world example, mean that all ham and spam classified mail
(for example by using buttons like `mark as spam') would be counted, which
should result in a good representation of the prior probabilities in any case.

\subsection{Threshold}
\label{sec:threshold}
In the case of e-mails, it is worse to classify an e-mail as spam, while it is
not, than the other way around. Therefore some kind of shifting the weight can be done to further ensure better categorization of ham mails as real ham. In our case we used a threshold for this task.\\
The threshold is set for mails categorized as spam that if the difference between the spam and ham posteriors is smaller than this threshold the mail is still weighted as a ham mail which ensures that not so many ham mails get categorized as spam. The categorization has the disadvantage that more spam mails are let through which of course is the downside of introducing such a threshold.
